package pl.devfest;

import pl.devfest.database.DatabaseHelper;
import android.app.Activity;

import com.j256.ormlite.android.apptools.OpenHelperManager;

public class GeneralActivity extends Activity {

    private DatabaseHelper databaseHelper;

    @Override
    protected void onDestroy() {
	super.onDestroy();

	if (databaseHelper != null) {
	    OpenHelperManager.releaseHelper();
	    databaseHelper = null;
	}
    }

    protected DatabaseHelper getHelper() {
	if (databaseHelper == null) {
	    databaseHelper = OpenHelperManager.getHelper(this,
		    DatabaseHelper.class);
	}
	return databaseHelper;
    }
}
